home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8167 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: ltisun13.epfl.ch!odowd
  2. From: odowd@ltisun13.epfl.ch (Mike Odowd)
  3. Newsgroups: comp.lang.c++
  4. Subject: Multiple copies of Virtual Tables
  5. Date: 15 Feb 1996 11:06:55 GMT
  6. Organization: Ecole Polytechnique Fidirale de Lausanne
  7. Message-ID: <4fv44f$qs3@info.epfl.ch>
  8. NNTP-Posting-Host: ltisun13.epfl.ch
  9.  
  10. Hi,
  11.  
  12. The size of my executable has been growing exponentially over
  13. the last few months. After investigation, I found that I have
  14. multiple copies of the virtual tables.
  15.  
  16. It seems that each source file that uses a class ends up with
  17. a copy of the class' virtual table in its object file. I one 
  18. case, I counted 91 object files that contain a copy of the
  19. same virtual table.
  20.  
  21. There are about 200 classes in the system, but I have 3885
  22. virtual tables. They represent approx 25% of the size of the
  23. executable once the symbols have been stripped. This code has
  24. to run on an embedded system with limited memory capacity and
  25. things are getting pretty tight.
  26.  
  27. Is there any way to make the virtual tables global, so that there
  28. is only one instance of each table?
  29.  
  30. I am using gcc v2.6.0
  31.  
  32.  
  33. Thanks for any help
  34.  
  35. Mike O'Dowd
  36. odowd@lightning.ch
  37.